package concurrent;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

/**
 *
 * Created by YT on 2015/10/23.
 */
public class ExecutorTest {

    private static final int  THREADNUMBERS = 100;
    private static final Executor exe = Executors.newFixedThreadPool(THREADNUMBERS);    //异步处理提交的任务

    public void doSomeThing() {

        while (true) {

            Runnable task = new Runnable() {
                public void run() {
                    System.out.print("hello world");
                }
            };

            exe.execute(task);
        }
    }
}
